package com.vdf.sisconsolid.persistencemodule;

import java.util.List;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

public class CopyOfSisconsolidManagerDaoImpl {

	EntityManager em;

	public CopyOfSisconsolidManagerDaoImpl() {
		EntityManagerFactory emf = Persistence
				.createEntityManagerFactory("persistenceTest");
		em = emf.createEntityManager();
	}
	
	public void persits(Object o) {
		em.persist(o);
	}
	
	public Object merge(Object o) {
		return em.merge(o);
	}
	
	public Object find(Class clazz, Object o) {
		return em.find(clazz, o);
	}
	
	public List<Object> list(Class clazz, String query) {
		return em.createNativeQuery(query, clazz).getResultList();
	}
}
